package parser

import (
	"engine"
	"regexp"
	"model"
	"strconv"
	"fmt"
)

const ageRe = `<td><span class="label">年龄：</span>([0-9]+)岁</td>`

func ParseProfile(contents []byte) engine.ParseResult {
	profile := model.Profile{}
	re := regexp.MustCompile(ageRe)
	match := re.FindSubmatch(contents)

	if match != nil {
		profile.Age, _ = strconv.Atoi(string(match[1]))
	}
	fmt.Printf("年龄：%d", profile.Age)
	return engine.ParseResult{

	}
}